﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 物品明细表
    /// </summary>
    [Table("PSS_ItemDetails")]
    public class ItemDetail: FullAuditedEntity<Guid>
    {
       
        public const int MaxNameLength = 50;
        public const int MaxCodeLength = 50;
        public const int MaxSpecificationLength = 50;
        public const int MaxUnitLength = 20;
        public const int MaxRemarkLegth = 200;
        
       
        /// <summary>
        /// 物品名称
        /// </summary>
        [Required]
        [MaxLength(MaxNameLength)]
        public virtual string ItemName { get; set; }
        /// <summary>
        /// 物品代码
        /// </summary>
        [MaxLength(MaxCodeLength)]
        public virtual string ItemCode { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        [MaxLength(MaxSpecificationLength)]
        public virtual string Specification { get; set; }
        /// <summary>
        /// 采购单价
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal PurchasePrice { get; set; }
        /// <summary>
        /// 销售单价
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal SalePrice { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        [MaxLength(MaxUnitLength)]
        public virtual string Units { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(MaxRemarkLegth)]
        public virtual string Remark { get; set; }
        /// <summary>
        /// 对于物品类别中的ID
        /// </summary>
        public Guid ItemCategoryId { get; set; }
        [ForeignKey("ItemCategoryId")]
        public ItemCategory ItemCategory { get; set; }
    }
}
